
const __WEBPACK_DEFAULT_EXPORT__ = {
    ToolBar: `<svg width="24" height="24" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g><rect width="48" height="48" fill="white" fill-opacity="0.01" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="none" fill-rule="evenodd"></rect><g transform="translate(6.000000, 8.000000)"><path d="M30,11 L6,11" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M36,1 L0,1" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M36,21 L0,21" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M30,31 L6,31" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path></g></g></svg>`,
    Left: `<svg width="24" height="24" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g><rect width="48" height="48" fill="white" fill-opacity="0.01" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="none" fill-rule="evenodd"></rect><g transform="translate(6.000000, 8.000000)"><path d="M36,1 L3.55271368e-15,1" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M28,11 L5.32907052e-15,11" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M36,21 L0,21" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M28,31 L5.32907052e-15,31" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path></g></g></svg>`,
    Center: `<svg width="24" height="24" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g><rect width="48" height="48" fill="white" fill-opacity="0.01" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="none" fill-rule="evenodd"></rect><g transform="translate(6.000000, 8.000000)"><path d="M30,11 L6,11" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M36,1 L0,1" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M36,21 L0,21" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path><path d="M30,31 L6,31" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="#333" fill="none" fill-rule="evenodd"></path></g></g></svg>`,
    Right: `<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"></rect><path d="M42 9H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M42 19H14" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M42 29H6" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path><path d="M42 39H14" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path></svg>`
};

const menuList = [
    {
        title: '左对其',
        codeLeft: "<p align=left>",
        codeRight: "</p>",
        icon: __WEBPACK_DEFAULT_EXPORT__.Left
    },
    {
        title: '居中对其',
        codeLeft: "<p align=center>",
        codeRight: "</p>",
        icon: __WEBPACK_DEFAULT_EXPORT__.Center
    },
    {
        title: '右对其',
        codeLeft: "<p align=right>",
        codeRight: "</p>",
        icon: __WEBPACK_DEFAULT_EXPORT__.Right
    }
];

export default (options) => {
    return {
        actions: [
            {
                icon: __WEBPACK_DEFAULT_EXPORT__.ToolBar,
                handler: Object.assign({
                    type: 'dropdown',
                    actions: menuList.map((item) => ({
                        title: item === null || item === void 0 ? void 0 : item.title,
                        icon: item.icon,
                        handler: {
                            type: 'action',
                            click({ wrapText, editor }) {
                                var _a;
                                wrapText(item.codeLeft, item.codeRight);
                                editor.focus();
                                (_a = options === null || options === void 0 ? void 0 : options.cb) === null || _a === void 0 ? void 0 : _a.call(options, item);
                            },
                        },
                    }))
                })
            }
        ]
    };
}

